package com.xiaouyudeguang.common.event;

import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import org.springframework.context.ApplicationEvent;

import java.util.Map;

@Getter
@Setter
@EqualsAndHashCode(callSuper = true)
public class LogEvent extends ApplicationEvent {

    private static final long serialVersionUID = 1L;

    private Map<String, Object> params;

    private String id;

    private String type;

    private String appId;

    private String tenantId;

    public LogEvent(String tenantId, String appId, String id, Object source) {
        super(source);
        this.id = id;
        this.appId = appId;
        this.tenantId = tenantId;
        this.type = source.getClass().getSimpleName();
    }
}
